/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.controller;

import java.util.List;
import queenb.net.entitybean.C475;
import queenb.web.store.C475Store;
import queenb.web.util.SessionProvider;
import queenb.web.util.Util;

/**
 *
 * @author Nguyen Hung
 */
public class C475Controller extends QueenbController {

    private int PC475;
    private String CV476;
    private String CV477;
    private int CN478;
    private int CN479;
    private int CN480;
    private String CV481;
    private String CV482;
    private C475Store c475Store;
    private List<C475> ccurpks_listoftabc475;

    public C475Controller() {
        c475Store = new C475Store();
        Object action = getRequest().getParameter("action");
        if (action != null) {
            if (action.equals("editC475")) {
                Object objPC475 = getRequest().getParameter("pc475");
                if (objPC475 != null) {
                    PC475 = Util.parseInt(objPC475);

                    List<C475> list = c475Store.ccurpks_listoftabc475(getLogin().getModule(), getLogin().getCompanyNo(), 0, getLogin().getUserName());
                    if (list != null) {
                        for (int i = 0; i < list.size(); i++) {
                            if (list.get(i).getPc475() == PC475) {
                                CV476 = list.get(i).getCv476();
                                CV477 = list.get(i).getCv477();
//                                CN478 = list.get(i).getCn478();
//                                CN479 = list.get(i).getCn429();
//                                CN480 = list.get(i).getCn429();
//                                CV481 = list.get(i).get();
//                                CV482 = list.get(i).getCn429();
                            }
                        }
                    }
                }
            } else if (action.equals("deleteC475")) {
                Object objPC475 = getRequest().getParameter("pc475");
                if (objPC475 != null) {
                    PC475 = Util.parseInt(objPC475);
                    SessionProvider.setSessionMapValue("IDC475DELETE", PC475);
                }
            }
        }
    }
      public void stdc_tools_stornotabc475() {
        try {
            int count = c475Store.stdc_tools_stornotabc475(Util.parseInt(SessionProvider.getSessionMapValue("IDC475DELETE")), getLogin().getUserName());
            if (count != 0) {
               
                System.out.println("-----THAM SO----");
            } else {
              
            }
        } catch (Exception e) {
        }
    }
    public void stdc_tools_inserttabc475() {
        try {
            //  System.out.println("-----THAM SO-----" + PC350 + "," + getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + FC425 + "," + CN351 + "," + pvCV352 + "," + pvCV353 + "," + getLogin().getUserName());
            int count = c475Store.stdc_tools_inserttabc475(PC475, getLogin().getModule(), getLogin().getCompanyNo(), CV476, CV477, CN478, CN479, CN480, CV481, CV482, getLogin().getUserName());
            if (count != 0) {
                showGlobalReport(true, getResourceString("success"));

            } else {
                showGlobalReport(true, getResourceString("error"));
            }

            sendRedirectUrlTab("setting.jsp?tab=header33&llinkC425=" + Util.convertMD5(getRequest().getRequestURI()));
        } catch (Exception e) {
        }
    }

    /**
     * @return the PC475
     */
    public int getPC475() {
        return PC475;
    }

    /**
     * @param PC475 the PC475 to set
     */
    public void setPC475(int PC475) {
        this.PC475 = PC475;
    }

    /**
     * @return the CV476
     */
    public String getCV476() {
        return CV476;
    }

    /**
     * @param CV476 the CV476 to set
     */
    public void setCV476(String CV476) {
        this.CV476 = CV476;
    }

    /**
     * @return the CV477
     */
    public String getCV477() {
        return CV477;
    }

    /**
     * @param CV477 the CV477 to set
     */
    public void setCV477(String CV477) {
        this.CV477 = CV477;
    }

    /**
     * @return the CN478
     */
    public int getCN478() {
        return CN478;
    }

    /**
     * @param CN478 the CN478 to set
     */
    public void setCN478(int CN478) {
        this.CN478 = CN478;
    }

    /**
     * @return the CN479
     */
    public int getCN479() {
        return CN479;
    }

    /**
     * @param CN479 the CN479 to set
     */
    public void setCN479(int CN479) {
        this.CN479 = CN479;
    }

    /**
     * @return the CN480
     */
    public int getCN480() {
        return CN480;
    }

    /**
     * @param CN480 the CN480 to set
     */
    public void setCN480(int CN480) {
        this.CN480 = CN480;
    }

    /**
     * @return the CV481
     */
    public String getCV481() {
        return CV481;
    }

    /**
     * @param CV481 the CV481 to set
     */
    public void setCV481(String CV481) {
        this.CV481 = CV481;
    }

    /**
     * @return the CV482
     */
    public String getCV482() {
        return CV482;
    }

    /**
     * @param CV482 the CV482 to set
     */
    public void setCV482(String CV482) {
        this.CV482 = CV482;
    }

    /**
     * @return the c475Store
     */
    public C475Store getC475Store() {
        return c475Store;
    }

    /**
     * @param c475Store the c475Store to set
     */
    public void setC475Store(C475Store c475Store) {
        this.c475Store = c475Store;
    }

    /**
     * @return the ccurpks_listoftabc475
     */
    public List<C475> getCcurpks_listoftabc475() {

        try {
            ccurpks_listoftabc475 = c475Store.ccurpks_listoftabc475(getLogin().getModule(), getLogin().getCompanyNo(), PC475, getLogin().getUserName());
            return ccurpks_listoftabc475;
        } catch (Exception e) {
            return null;
        }
    }

    /**
     * @param ccurpks_listoftabc475 the ccurpks_listoftabc475 to set
     */
    public void setCcurpks_listoftabc475(List<C475> ccurpks_listoftabc475) {
        this.ccurpks_listoftabc475 = ccurpks_listoftabc475;
    }
}
